<!DOCTYPE html>
<!--解决idea thymeleaf 表达式模板报红波浪线-->
<!--suppress ALL -->
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="缓存页面"></title>
    <!-- 引入公用部分 -->
    <script th:replace="head::static"></script>
</head>
<body>
<div class="main">
    <fieldset class="layui-elem-field site-demo-button">
        <legend>清除系统缓存</legend>
        <div>
            <button type="button" class="layui-btn layui-btn-radius" onclick="deleteCache('2kMenu')">重载2k</button>
            <button type="button" class="layui-btn layui-btn-radius" onclick="deleteCache('LimiterMenu')">重载限流</button>
        </div>
    </fieldset>
</div>
</body>
<script th:inline="javascript">
    layui.use([ 'layer',  'util']);
    function deleteCache(key) {
        layer.confirm('确认删除吗？', function (index) {
            //向服务端发送删除指令
            $.delete(ctx + "/manage/cache/delete/" + key, {}, function (data) {
                layer.close(index);
            })
        });
    }
</script>
</html>